﻿@using PhoneBook.Core.Domain.Phones
@using PhoneBook.Models.Contacts
@model IEnumerable<PhoneBook.Models.Contacts.ContactListModel>
@{
}








@foreach (ContactListModel item in Model)
{
    <div>

        @Html.Partial("_ContactListItem", item)

    </div>
}

<script>
    

   function DeleteContact(url) {
        if(confirm('确认删除？')) {
            $.ajax(url, {
                type: "post",
                contentType: "application/json",
                success: function(result) {
                    if (result.Status == "success") {
                        alert('删除成功');

                        location.reload();
                    }
                    else {
                        alert('删除失败');
                        location.reload();
                    }
                }
            });

        }
   }
   
</script>